home *** CD-ROM | disk | FTP | other *** search
- Path: anvil.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Checking For Keyboard Input
- Date: 28 Feb 1996 12:41:31 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4h2elrINNp0k@anvil.ugrad.cs.ubc.ca>
- References: <cerebus.34.000DD98A@voicenet.com> <4gqm3pINNkbu@keats.ugrad.cs.ubc.ca> <1176@altheim.win-uk.net>
- NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
-
- In article <1176@altheim.win-uk.net>,
- Brian R. Oldham <broldham@altheim.win-uk.net> wrote:
- >
- >In article <4gqm3pINNkbu@keats.ugrad.cs.ubc.ca>, Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) writes:
- >>In article <cerebus.34.000DD98A@voicenet.com>,
- >>aLEX <cerebus@voicenet.com> wrote:
- >>>Hello fellow C programmers,
- >>
- >>That's a little presumptious, don't you think?
- >>
- >
- >Also of you to say so, Kazi.
- >
- >>> Is there anyway to check if keyboard input has been entered without
- >>>actually stalling the excution of the code until the user presses a key. I
- >>>would really like to do this but I can't seem to find any way. If you know of
- >>>a way PLEASE email me or post it. Thank you in advance.
- >>
- >>This question comes up not fewer than 10 times a week in this newsgroup, yet it
- >>has nothing to do with the C language. It is more than adequatly covered in the
- >>FAQ, as you would know if you had read it.
- >>--
- >
- >If you had not been so preoccupied with your annoyance at aLEX's
- >greeting you might have answered his query - or ignored it. A simple
-
- I wasn't annoyed with the greeting at all.
-
- >brief mention of kbhit() or equivalent, or a call to whatever interrupt
-
- kbhit() is not a standard function. Are you advocating that we give incorrect
- answers on comp.lang.c? I don't know what ``whatever interrupt'' is, nor should
- I have to. What makes you sure that kbhit() is available in aLEX's programming
- environment? He could easily be using UNIX, which is likely, since the method
- for doing such a check is somewhat more occluded from common knowledge than
- under DOS. Anyone who knows how to read can readily discover the answer from
- their (legitimately purchased) compiler's manual on this platform. Just look up
- "keyboard" in the index of your MS, Borland, Watcom or Symantec documentation
- and you will likely find a reference to kbhit() in no time.
-
- >pauses the keyboard would have been helpful, but you may be assured,
- >none of us appreciate supercilious resposes such as this. Are you going
- >to post this crap *every* time a newbie asks a question?
-
- Nope! I think I have pretty much kicked the habit already.
-
- Nevertheless, the fact is, whether or not there is a way to access keyboard
- buffers in C, the question _is_ answered in the FAQ. Even "Internet for
- Dummies" kinds of books clearly tell you where you can get Usenet FAQ's when
- they don't appear in the actual newsgroup. The response may have been
- supercilious, but pointing the FAQ is a lot more proper than what you suggest.
- I should have done so in an e-mail message, course, and for not doing so I must
- apologize.
-
- If the poster had followed read _any_ of the newsgroup _at all_ for even a day
- or two, he could have come across a thread that already discusses this. A
- simple subject search for "keyboard" will probably dig up some back articles
- (assuming the poster's NNTP server keeps a few). Proper netiquette says that
- you follow a newsgroup a little bit before adding articles, and read some
- FAQ's.
-
- You are absolutely right that responding to such posts publicly only
- multiplies the spam.
- --
-
-